package com.example.zwh.activitytest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

//public class SecondActivity extends AppCompatActivity {
public class SecondActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_layout);
//        Intent intent = getIntent();
//        String data = intent.getStringExtra("extra_data");
        Log.d("SecondActivity", "Task id is " + getTaskId());
        Button buttonReturn = (Button) findViewById(R.id.button_return);
        buttonReturn.setOnClickListener(new View.OnClickListener() {
            public void onClick(View V) {
//                Intent intent = new Intent();
//                intent.putExtra("data_return", "Hello FirstActivity哈哈");
//                setResult(RESULT_OK, intent);
//                finish();
//                Intent intent = new Intent(SecondActivity.this, SecondActivity.class);
//                startActivity(intent);
                Intent intent = new Intent(SecondActivity.this, ThirdActivity.class);
                startActivity(intent);
            }
        });
    }
    public void onDestory() {
        super.onDestroy();
        Log.d("SecondActivity", "onDestory");
    }
}
